package com.cxso.example.client;


import com.cxso.example.enums.ProductClientEnum;
import com.cxso.example.request.wlpt.*;
import com.cxso.example.response.wlpt.*;
import com.cxso.example.sdk.domain.Result;
import com.cxso.example.sdk.http.base.HttpMethod;
import com.cxso.example.sdk.http.client.Client;
import com.cxso.example.sdk.http.core.ChoiceClient;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.HashMap;


@Schema(description = "聚合代理商服务")
public class MergeAgentWlptClient extends Client {

    public MergeAgentWlptClient(ChoiceClient choiceClient) {
        super(choiceClient);
    }

    @Schema(description = "新增货主")
    public Result<ApiConsignorOwnerCreateRes> ownerCreate(ApiConsignorOwnerCreateReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/createOwner", HttpMethod.POST, request).toEntity(ApiConsignorOwnerCreateRes.class);
    }

    @Schema(description = "新增司机")
    public Result<ApiConsignorDriverCreateRes> driverCreate(ApiConsignorDriverCreateReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/createDriver", HttpMethod.POST, request).toEntity(ApiConsignorDriverCreateRes.class);
    }

    @Schema(description = "新增车辆")
    public Result<ApiConsignorVehicleCreateRes> vehicleCreate(ApiConsignorVehicleCreateReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/createVehicle", HttpMethod.POST, request).toEntity(ApiConsignorVehicleCreateRes.class);
    }

    @Schema(description = "新增车队长")
    public Result<ApiConsignorLeaderCreateRes> leaderCreate(ApiConsignorLeaderCreateReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/createLeader", HttpMethod.POST, request).toEntity(ApiConsignorLeaderCreateRes.class);
    }

    @Schema(description = "新增收款信息")
    public Result<ApiConsignorPayeeCreateRes> payeeCreate(ApiConsignorPayeeCreateReq request, HashMap<String, String> headers) {
        return choiceClient.choice(ProductClientEnum.MERGE_ENTERPRISE.getCode()).setHeaders(headers).execute("/merge/api/wlpt/consignor/createPayee", HttpMethod.POST, request).toEntity(ApiConsignorPayeeCreateRes.class);
    }

}
